package com.yao.spider.zhihu.task;

import com.yao.spider.zhihu.Page;
import com.yao.spider.zhihu.task.AbstractPageTask;

/**
 * Created by 单耀 on 2017/12/16.
 * 下载初始化authorization字段页面
 */
public class GenernalPageTask extends AbstractPageTask{
    private Page page = null;

    public GenernalPageTask(String url, boolean proxyFlag) {
        super(url,proxyFlag);
    }

    public void handle(Page page) {
        this.page = page;
    }

    public void retry() {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        this.run();//重试下载
    }

    public Page getPage() {
        return page;
    }
}
